<template>
  <n-grid :cols="12" item-responsive responsive="screen">
    <n-gi span="12 m:8 l:6" offset="0 m:2 l:3">
      <n-space vertical>
        <n-empty description="暂时没有任何东西哦" v-if="discussList && discussList.length == 0">
          <template #extra>
          </template>
        </n-empty>
        <template v-for="discuss in discussList">
          <n-card>
            <n-thing>
              <template #header>
                <n-button text @click="router.push({name:'student_discuss_detail',params:{discussID:discuss.discussID}})">{{ discuss.theme }}</n-button>
              </template>
              <template #header-extra>
                <n-space>
                  <n-tag type="info">
                    积分:{{ discuss.credit }}
                  </n-tag>
                </n-space>
              </template>
              <template #action>

              </template>
            </n-thing>
          </n-card>
        </template>

      </n-space>
    </n-gi>
  </n-grid>

</template>
<script lang="ts" setup>

import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { getDiscussList} from '@/api/student/discuss';

const route = useRoute();
const router = useRouter();




const discussList: any = ref([]);



onMounted(
  async () => {
    discussList.value = await getDiscussList({ courseID: route.params.courseID });
  }
)



</script>